package com.example.midushop.service.product.impl;

import com.example.midushop.entity.product.spu.SPU_detail;
import com.example.midushop.mapper.product.spu.SPU_detailMapper;
import com.example.midushop.service.product.SPU_detailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 商品spu富文本介绍服务接口实现类
 */
@Service
public class SPU_detailServiceImpl implements SPU_detailService {
    @Autowired
    SPU_detailMapper spu_detailMapper;

    /**
     * 根据商品ID,添加对应的商品富文本介绍
     * @param spu_id 商品ID
     * @param content 富文本介绍
     * @return 返回成功添加受影响行数
     */
    @Override
    public int addDetail(long spu_id, String content) {
        return spu_detailMapper.addDetail(spu_id,content);
    }

    /**
     * 根据商品SPU_id查询商品富文本介绍
     * @param spu_id 商品spu_id
     * @return 返回SPU_detail对象
     */
    @Override
    public SPU_detail findSPU_detail(long spu_id) {
        return spu_detailMapper.findSPU_detail(spu_id);
    }
}
